package Library.Model;

import java.io.Serializable;
import java.util.Objects;

public class User implements Serializable {
    private String user_name;
    private String user_pass;
    private boolean user_privileged;
    
    public User(String name, String pass){
        this.user_name = name;
        this.user_pass = pass;
        this.user_privileged = false;
    }
    
    public User(String name, String pass, boolean privileged){
        this.user_name = name;
        this.user_pass = pass;
        this.user_privileged = privileged;
    }
    
    public String getUserName(){
        return this.user_name;
    }
    
    public String getUserPass(){
        return this.user_pass;
    }
    
    public boolean getUserPrivileged(){
        return this.user_privileged;
    }
    
    public void setUserName(String name){
        this.user_name = name;
    }
    
    public void setUserPass(String pass){
        this.user_pass = pass;
    }
    
    public void setUserPrivileged(boolean privileged){
        this.user_privileged = privileged;
    }
    
    @Override
    public String toString(){
        return (this.user_name + ";" + this.user_pass + ";" + this.user_privileged);
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 89 * hash + Objects.hashCode(this.user_name);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final User other = (User) obj;
        if (!Objects.equals(this.user_name, other.user_name)) {
            return false;
        }
        return true;
    }
    
    
    
}

